package com.metroinfo.infrastructure;

import java.util.concurrent.ConcurrentHashMap;

import com.metroinfo.infrastructure.keys.LineInfoDataKey;
import com.metroinfo.infrastructure.value.LineInfoValue;
import com.metroinfo.interfaces.DataStructInterface;

public class LineInfoData implements DataStructInterface{

	ConcurrentHashMap<LineInfoDataKey, LineInfoValue> lineInfoData = new ConcurrentHashMap<LineInfoDataKey, LineInfoValue>();
	
	public LineInfoData(int i){

		for(int g=0;g<i;g++)
		{
			LineInfoValue lineInfoValue = new LineInfoValue();
			LineInfoDataKey lineInfoDataKey = new LineInfoDataKey(g+1);
			
			lineInfoData.put(lineInfoDataKey, lineInfoValue);
		}
	}

	@Override
	public Object getValue(Object o) {
		return lineInfoData.get((LineInfoDataKey)o);
	}

	@Override
	public boolean isExists(Object o) {
		return lineInfoData.containsKey((LineInfoDataKey)o);
	}

	@Override
	public boolean refresh() {
		return true;
	}
	
}
